class_name HurtComponet
extends Area2D

@export var tool:DataTypes.Tools =DataTypes.Tools.None

signal  hurt

func _on_area_entered(_area: Area2D) -> void:
	var hit_component = _area as HitComponent
	if tool == hit_component.current_tool:
		hurt.emit(hit_component.hit_damage)
	print("攻击方式:%s"%hit_component.current_tool)
	print("需要的方式:%s"%tool)

func _on_area_exited(_area: Area2D) -> void:
	pass # Replace with function body.
